Skip to content

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Oct 9, 2025

Motivation

Description

Spec defines that legacy and eip 2930 txs should use 256 bits, we were using 64 bits.

Closes #3629

@JereSalo JereSalo changed the title initial changes fix(l1): change gas price unit used in Legacy and EIP-2930 transactions Oct 9, 2025
@github-actions github-actions bot added the L1 Ethereum client label Oct 9, 2025
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Benchmark Results Comparison

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 4.769 ± 0.016 4.752 4.793 1.02 ± 0.00
main_levm_BubbleSort 4.658 ± 0.012 4.636 4.676 1.00
pr_revm_BubbleSort 4.750 ± 0.014 4.734 4.775 1.02 ± 0.00
pr_levm_BubbleSort 4.663 ± 0.013 4.650 4.693 1.00 ± 0.00

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.560 ± 0.008 1.550 1.573 1.00
main_levm_ERC20Approval 1.641 ± 0.008 1.633 1.659 1.05 ± 0.01
pr_revm_ERC20Approval 1.560 ± 0.007 1.554 1.578 1.00 ± 0.01
pr_levm_ERC20Approval 1.655 ± 0.007 1.646 1.670 1.06 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 186.4 ± 2.1 183.0 190.6 1.00
main_levm_ERC20Mint 198.9 ± 2.3 197.6 205.2 1.07 ± 0.02
pr_revm_ERC20Mint 187.0 ± 1.0 185.8 189.4 1.00 ± 0.01
pr_levm_ERC20Mint 200.2 ± 4.5 197.2 212.6 1.07 ± 0.03

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 358.6 ± 2.3 356.2 363.3 1.00
main_levm_ERC20Transfer 386.1 ± 1.7 383.7 388.6 1.08 ± 0.01
pr_revm_ERC20Transfer 359.7 ± 7.6 356.3 381.2 1.00 ± 0.02
pr_levm_ERC20Transfer 388.7 ± 1.9 386.0 391.7 1.08 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 240.7 ± 0.5 240.2 241.8 1.00
main_levm_Factorial 281.6 ± 2.5 279.6 288.4 1.17 ± 0.01
pr_revm_Factorial 243.7 ± 1.7 242.2 248.1 1.01 ± 0.01
pr_levm_Factorial 279.6 ± 1.7 277.9 283.1 1.16 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.706 ± 0.031 1.671 1.750 1.00
main_levm_FactorialRecursive 8.146 ± 2.118 2.124 8.992 4.78 ± 1.24
pr_revm_FactorialRecursive 1.719 ± 0.037 1.633 1.762 1.01 ± 0.03
pr_levm_FactorialRecursive 8.677 ± 0.090 8.547 8.891 5.09 ± 0.11

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 216.2 ± 0.8 214.5 217.3 1.00
main_levm_Fibonacci 256.8 ± 4.4 252.9 267.0 1.19 ± 0.02
pr_revm_Fibonacci 221.0 ± 12.8 215.7 257.4 1.02 ± 0.06
pr_levm_Fibonacci 256.2 ± 1.7 254.6 259.7 1.18 ± 0.01

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 891.4 ± 6.0 883.9 899.1 1.00
main_levm_FibonacciRecursive 1050.9 ± 10.3 1038.4 1069.0 1.18 ± 0.01
pr_revm_FibonacciRecursive 892.6 ± 7.6 880.3 903.9 1.00 ± 0.01
pr_levm_FibonacciRecursive 1045.6 ± 11.8 1035.0 1070.5 1.17 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 12.5 ± 0.1 12.4 12.6 1.00
main_levm_ManyHashes 14.0 ± 0.3 13.8 15.0 1.12 ± 0.03
pr_revm_ManyHashes 12.6 ± 0.1 12.5 12.8 1.01 ± 0.01
pr_levm_ManyHashes 13.9 ± 0.1 13.8 14.1 1.12 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 273.6 ± 2.7 271.4 280.7 1.00 ± 0.01
main_levm_MstoreBench 761.2 ± 4.0 757.6 771.1 2.78 ± 0.03
pr_revm_MstoreBench 273.6 ± 3.0 271.4 281.4 1.00
pr_levm_MstoreBench 758.9 ± 4.9 753.9 770.7 2.77 ± 0.04

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 302.9 ± 1.6 300.7 305.7 1.00
main_levm_Push 835.4 ± 5.4 831.5 848.4 2.76 ± 0.02
pr_revm_Push 304.2 ± 3.4 301.2 313.2 1.00 ± 0.01
pr_levm_Push 834.7 ± 5.4 829.9 848.2 2.76 ± 0.02

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 219.8 ± 1.0 219.3 222.6 2.38 ± 0.02
main_levm_SstoreBench_no_opt 92.5 ± 0.8 90.9 93.4 1.00
pr_revm_SstoreBench_no_opt 220.4 ± 0.7 219.5 222.2 2.38 ± 0.02
pr_levm_SstoreBench_no_opt 94.7 ± 6.1 92.0 112.1 1.02 ± 0.07

Base automatically changed from support_blockchain_tests to main October 9, 2025 14:09
@JereSalo JereSalo changed the base branch from main to skipped_tests_reason October 9, 2025 14:48
@JereSalo JereSalo changed the title fix(l1): change gas price unit used in Legacy and EIP-2930 transactions fix(l1): use 256 bits for gas price in Legacy and EIP-2930 transactions Oct 9, 2025
@JereSalo JereSalo moved this to In Progress in ethrex_l1 Oct 13, 2025
@JereSalo JereSalo marked this pull request as ready for review October 13, 2025 13:55
@JereSalo JereSalo requested a review from a team as a code owner October 13, 2025 13:55
@ethrex-project-sync ethrex-project-sync bot moved this from In Progress to In Review in ethrex_l1 Oct 13, 2025
Base automatically changed from skipped_tests_reason to main October 15, 2025 16:32
@Copilot Copilot AI review requested due to automatic review settings October 15, 2025 17:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Switch Legacy and EIP-2930 transaction gas_price from 64-bit to 256-bit to align with the spec and enable handling of high gas prices.

  • Change gas_price type to U256 for Legacy and EIP-2930 transactions and update migrations/serde accordingly.
  • Update effective_gas_price and total_cost calculations to operate on U256.
  • Adjust tests, helpers, and VM/backend paths; remove u64 casting where no longer needed.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tooling/migrations/src/utils.rs Convert stored gas_price to U256 during migration.
tooling/ef_tests/state_v2/src/modules/runner.rs Use U256 gas_price from test vectors for Legacy/EIP-2930.
tooling/ef_tests/blockchain/types.rs Keep gas_price as U256 when converting from generic Transaction.
tooling/ef_tests/blockchain/tests/all.rs Update skip list comment; remove skip for high gas price test.
crates/vm/levm/runner/src/input.rs Pass through U256 gas_price directly.
crates/vm/backends/levm/mod.rs Stop converting effective_gas_price to U256 as it now returns U256.
crates/networking/rpc/types/receipt.rs Fetch effective_gas_price from tx; currently downcasts to u64.
crates/networking/rpc/eth/mod.rs Update test helper to produce U256 gas_price.
crates/common/types/transaction.rs Change gas_price to U256 in Legacy/EIP-2930, compute effective gas price and total cost with U256, and update serde and helpers.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JereSalo JereSalo enabled auto-merge October 15, 2025 19:10
@JereSalo JereSalo added this pull request to the merge queue Oct 15, 2025
Merged via the queue into main with commit 892a497 Oct 15, 2025
48 checks passed
@JereSalo JereSalo deleted the change_gas_price_bits branch October 15, 2025 19:53
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

L1: Use 256 bits for gas price in Legacy and EIP-2930 transactions

3 participants